{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 01-01 直接导入SolidWorks模型到coppelia中【失败】\n",
    "\n",
    "### SolidWorks模型导出\n",
    "\n",
    "完成SolidWorks中对四足机器人零件的设计和装配后，通过另存为操作导出成stl格式的模型文件。\n",
    "\n",
    "在导出时需要做两个设置：（1）单位设置为mmkg；（2）导出时勾选装配体一起输出。\n",
    "\n",
    "### 模型文件导入copplia\n",
    "\n",
    "copplia导入stl格式的模型文件时，选择前述所有输出的stl文件一同导入。\n",
    "导入完成后，将表示装配体的shape删除。\n",
    "\n",
    "![](./images/coppeliaModel.jpg)\n",
    "\n",
    "然后将各零件的名称改成有意义的名字。\n",
    "\n",
    "### 加入简单实体\n",
    "\n",
    "前面导入的mesh文件细节非常多，而且导入时各对象的惯性参数是没有的，直接使用不仅慢，而且会得到错误的结果。\n",
    "\n",
    "解决此问题的一个办法就是加入与各连杆对应的简单实体，以仿真物理过程。同时将前面导入的模型文件作为蒙皮，仅用于显示。\n",
    "\n",
    "\n",
    "\n",
    "\n",
    "\n",
    "\n",
    "\n",
    "\n",
    "然后在模型中加入关节。\n",
    "这里有一个技巧，可以在调试关节时先将本体固定在世界中。也就是不选中本体的动态复选框，这样本体在仿真环境中的位置保持不变。\n",
    "将髋部通过关节与本体相连后，通过修改关节的初始角度，查看关节方向的设置是否与预定一致。\n",
    "\n",
    "本体在世界坐标系中的状态为：侧向右方为x方向，前方为y方向，上方为z方向。\n",
    "\n",
    "各关节相对于本体中心的位置如下：\n",
    "- joint_HL1(-0.18,0.565,-0.145)\n",
    "- joint_HL2(0.18,0.565,-0.145)\n",
    "- joint_HL3(-0.18,-0.565,-0.145)\n",
    "- joint_HL4(0.18,-0.565,-0.145)\n",
    "\n",
    "- joint_HF1(-0.18,0.315,-0.205)\n",
    "- joint_HF2(0.18,0.315,-0.205)\n",
    "- joint_HF3(-0.18,-0.315,-0.205)\n",
    "- joint_HF4(0.18,-0.315,-0.205)\n",
    "\n",
    "\n",
    "\n",
    "。。。\n",
    "\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.6.11"
  },
  "toc": {
   "base_numbering": 1,
   "nav_menu": {},
   "number_sections": true,
   "sideBar": true,
   "skip_h1_title": false,
   "title_cell": "Table of Contents",
   "title_sidebar": "Contents",
   "toc_cell": false,
   "toc_position": {},
   "toc_section_display": true,
   "toc_window_display": false
  }
 },
 "nbformat": 4,
 "nbformat_minor": 4
}
